<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>小牛电动车</title>
<style>
h2{text-align:center;}
table{border-collapse:collapse;margin:auto;}
td{border:1px solid black;text-align:center;white-space: nowrap;padding:5px;}
td:nth-child(2){background:lime;}
td:nth-child(5){background:lime;}
</style>
</head>
<body>
<div id=json></div>
<div id=tb></div>
</body>
<script>
var car=new Array();
car[0]=['型号','价格','电芯品牌','电压','容量','额定功率','续航','前减震','后减震','后平叉','前制动','后制动','仪表屏幕材料','感光探头','自动转向回正','自动回正提示音'];
car[1]=['N1都市版','3999元','?','60V','20AH','800W','100KM','套筒、油阻尼式','套筒、油阻尼式','-','碟刹','碟刹','?','-','-','-'];
car[2]=['N1动力版','4999元','?','60V','26AH','1200W','100KM','套筒、油阻尼式','套筒、油阻尼式','-','碟刹','碟刹','?','-','-','-'];
car[3]=['M1Lite','3299元','国产一线','48V','15AH','400W','50KM','套筒、油阻尼式','弹簧、油阻尼式','铝钛合金一体式','碟刹','鼓刹','HTN','无','无','无'];
car[4]=['M1C','3999元','松下/LG/三星','48V','20AH','600W','80KM','套筒、油阻尼式','弹簧、油阻尼式','铝钛合金一体式','碟刹','鼓刹','HTN','有','有','有'];
car[5]=['M1S','4999元','松下/LG/三星','48V','26AH','800W','100KM','套筒、油阻尼式','弹簧、油阻尼式','铝钛合金一体式','碟刹','鼓刹','FSTN','有','有','有'];
car[6]=['M1pro','6299元','松下GA','48V','32AH','1200W','120KM','套筒、油阻尼式','弹簧、油阻尼式','铝钛合金一体式','碟刹','鼓刹','FSTN','有','有','有'];
//var json = JSON.stringify(car);
//document.getElementById('json').innerHTML=json;
var ts='<h2>小牛电动车</h2><table id=main>';
for(var i=0;i<car[0].length;i++){
 ts+='<tr>';
 for(var j=0;j<car.length;j++){
  ts+='<td>'+car[j][i]+'</td>';
 }
 ts+='</tr>';
}
ts+='</table>';
document.getElementById('tb').innerHTML=ts;
</script>
</html>
